home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / latex209 / contrib / misc / rcs.sty < prev    next >
Text File  |  1992-02-12  |  2KB  |  68 lines

  1. %%
  2. %% REVISION CONTROL 
  3. %% Piet van Oostrum, Dept of Computer Science, Utrecht University,
  4. %% Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands.
  5. %% Telephone: +31 30 531806   Uucp:   uunet!mcsun!ruuinf!piet
  6. %% Telefax:   +31 30 513791   Internet:  piet@cs.ruu.nl
  7. %%
  8. %% To use the RCS field XXX (e.g. XXX=Header or XXX=Date) in a (La)TeX
  9. %% document include
  10. %%  \RCS$XXX$
  11. %% This is expanded by RCS into \RCS$XXX: <value> $
  12. %% The TeX macro above defines (globally) \RCSXXX to be <value>.
  13. %% If the field XXX is not RCS-expanded \RCSXXX is defined as the null string.
  14. %%
  15. %% Exception:
  16. %% For XXX=Date, if the macro \today is defined, the RCS date is
  17. %% reparsed into the format defined by \today, with \year, \month and \day
  18. %% bound to the values in the RCS Date field. This allows you to get a
  19. %% language-dependent date format, e.g. by using dutch.sty, german.sty etc.
  20. %% The time part is put into the macro \RCSTime. The original RCS date can
  21. %% be found in \RCSRawDate.
  22. %% Also the default value for \RCSDate is the value of \today.
  23. %%
  24. %% Note: This kind of special-casing can be applied to other fields also by
  25. %% defining a macro \RCS@XXX. This macro will be called with the field
  26. %% <value> as argument and should do all the work (including defining \RCSXXX).
  27. %%
  28. %% N.B:
  29. %% Verbatim insertion can not be done in this way. Just use \verb$XXX$, or
  30. %% put $XXX$ in a verbatim environment. And of course you can put a field
  31. %% in comment (useful for the Log entry).
  32.  
  33. \def\RCS$#1${\RCS@#1:$}
  34. \def\RCS@#1:#2${%
  35.         {\def\temp@{#2}%
  36.         \ifx\temp@\empty
  37.                 \RCS@@#1:$%
  38.         \else
  39.                 \RCS@@@#1:#2$%
  40.         \fi}
  41. }
  42. \def\RCS@@#1:#2${\RCS@@@#1: #2 :$}
  43. \def\RCS@@@#1: #2 :${%
  44.         \expandafter\ifx\csname RCS@#1\endcsname\relax
  45.                 \expandafter\gdef\csname RCS#1\endcsname{#2}
  46.         \else
  47.                         \csname RCS@#1\endcsname{#2}
  48.         \fi
  49. }
  50. \def\RCS@Date#1{%
  51.         \gdef\RCSRawDate{#1}%
  52.         \ifx\today\relax
  53.                 \gdef\RCSDate{#1}%
  54.         \else
  55.                 \ifx\temp@\empty %Note: temp@ still valid from the \RCS@ call
  56.                         \gdef\RCSDate{\today}%
  57.                 \else
  58.                         \RCS@@Date #1$%
  59.                 \fi
  60.         \fi
  61. }
  62. \def\RCS@@Date #1/#2/#3 #4${
  63.         \gdef\RCSTime{#4}%
  64.         \def\year{#1}\def\month{#2}\def\day{#3}% Note: we are in a group by RCS@
  65.          \xdef\RCSDate{\today}
  66. }
  67. \def\RCSTime{}
  68.